<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <script src="./lib/vue.js"></script>
    <title>Document</title>
    <style>
        .header {
            font-size: 0;
            width: 600px;
            border-bottom: 1px solid #666;
        }
       .header a{
            height: 40px;
            line-height: 40px;
            width: 25%;
            display: inline-block;
            text-align: center;
            color: #333;
            text-decoration: none;
            font-size: 16px;
        }
        .show > div{
            border: 1px solid #ccc;
            height: 400px;
            padding-top: 20px;
        }
        .selected {
            background-color: #09f;
            color: #fff !important;
        }
        .tab {
            width: 600px;
            margin: 0 auto;
            border:1px solid black;
        }

    </style>
</head>
<body>
   <div id="app">
       <div class="tab">
            <div class="header">
                    <a :class="{selected:currentPage==0}" href="#" @click.prevent="changePage(0)">《静夜思》</a>
                    <a :class="{selected:currentPage==1}"  href="#" @click.prevent="changePage(1)">《春夜喜雨》</a>
                    <a :class="{selected:currentPage==2}"  href="#" @click.prevent="changePage(2)">《春晓》</a>
                    <a :class="{selected:currentPage==3}"  href="#" @click.prevent="changePage(3)">《咏柳 / 柳枝词》</a>
               </div>
               <div class="show">
                   <div v-show="currentPage==0">床前明月光，疑是地上霜。举头望明月，低头思故乡。</div>
                   <div v-show="currentPage==1">好雨知时节，当春乃发生。随风潜入夜，润物细无声。野径云俱黑，江船火独明。晓看红湿处，花重锦官城。</div>
                   <div v-show="currentPage==2">春眠不觉晓，处处闻啼鸟。夜来风雨声，花落知多少。</div>
                   <div v-show="currentPage==3">碧玉妆成一树高，万条垂下绿丝绦。不知细叶谁裁出，二月春风似剪刀。</div>
               </div>
       </div>
   </div>
</body>
<script>
        var vm= new Vue({
            el:'#app',
            data:{
                currentPage:0
            },
            methods:{
                changePage(page){
                    this.currentPage = page

                }

            }
        })

</script>
</html>